package ltd.hxya.novel.crawl.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import ltd.hxya.novel.crawl.mapper.LastCrawlIndexMapper;
import ltd.hxya.novel.crawl.service.ILastCrawlIndexService;
import ltd.hxya.novel.entity.crawl.LastCrawlIndex;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hty
 * @since 2022-11-19
 */
@Service
public class LastCrawlIndexServiceImpl extends ServiceImpl<LastCrawlIndexMapper, LastCrawlIndex> implements ILastCrawlIndexService {

    @Override
    public List<LastCrawlIndex> getLastIndexList(Integer crawlId) {
        QueryWrapper<LastCrawlIndex> crawlIndexQueryWrapper = new QueryWrapper<>();
        crawlIndexQueryWrapper.eq("crawl_source_id",crawlId);
        List<LastCrawlIndex> lastCrawlIndices = this.baseMapper.selectList(crawlIndexQueryWrapper);
        return lastCrawlIndices;
    }
}
